import { createCollegeData } from '@/utils/college-cascader.js'

// mixins: [mixinCollegeData],
export const mixinCollegeData = {
  data() {
    return {
      filterData: {
        collegeId: null,
        professionId: null,
        classId: null,
      },

      collegeOptions: [],
      professionOptions: [],
      classOptions: [],
    }
  },

  created() {
    // 学院 院系 班级 级联数据
    const {
      collegeId,
      professionId,
      classId,
      collegeOptions,
      professionOptions,
      classOptions,
    } = createCollegeData()

    this.filterData.collegeId = collegeId
    this.filterData.professionId = professionId
    this.filterData.classId = classId
    this.collegeOptions = collegeOptions
    this.professionOptions = professionOptions
    this.classOptions = classOptions
  },
}

// import { mixinDict } from '@/utils/dict.js'
// mixins: [mixinDict],
export const mixinDict = {
  data() {
    return {
      // 静态字典
      dictMap: [],
      dict: {},
    }
  },

  created() {
    // 获取静态
    const dictList = this.useDict(this.dictMap)
    for (let f1 in dictList) {
      this.dict[f1] = dictList[f1]
    }
  },
}
